package com.jiayinlending.jiayindai.activity.login;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.jiayinlending.jiayindai.R;
import com.jiayinlending.jiayindai.activity.MainActivity;
import com.jiayinlending.jiayindai.activity.base.BaseActivity;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

import static com.jiayinlending.jiayindai.R.id.bt_login;
import static com.jiayinlending.jiayindai.R.id.et_phonenum;
import static com.jiayinlending.jiayindai.R.id.et_psd;
import static com.jiayinlending.jiayindai.R.id.tv_forget;
import static com.jiayinlending.jiayindai.R.id.tv_register;

/**
 * Created by xiaohei on 2017/4/5.
 */

public class LoginActivity extends BaseActivity {
    @Bind(et_phonenum)
    EditText etPhonenum;
    @Bind(et_psd)
    EditText etPsd;
    @Bind(bt_login)
    Button btLogin;
    @Bind(tv_forget)
    TextView tvForget;
    @Bind(tv_register)
    TextView tvRegister;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ButterKnife.bind(this);
        getToolbarTitle().setText("登录");
        getSubTitle().setText("");
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_login;
    }


    @OnClick({et_phonenum, et_psd, bt_login, tv_forget, tv_register})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case et_phonenum:
                break;
            case et_psd:
                break;
            case bt_login:
                startActivity(new Intent(LoginActivity.this, MainActivity.class));
                break;
            case tv_forget:
                startActivity(new Intent(LoginActivity.this, FindPasswordActivity.class));
                break;
            case tv_register:
                startActivity(new Intent(LoginActivity.this, RegisterActivity.class));
                break;
        }
    }
}
